//
//  HMNetWorkTool.h
//  HowToDo
//
//  Created by 胡坤 on 2017/1/3.
//  Copyright © 2017年 KY. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import <UShareUI/UShareUI.h>

typedef NS_ENUM(NSInteger,RequestType)
{
    HTDGET,
    HTDPOST
};


/**
Wraning: 对该类内容进行修改和新增时提前通知其他协同开发人员，尽量在大家在同一版本代码情况下，进行修改或者新增，推送完成后及时通知其他人员更新代码！！！
 */
@interface HMNetWorkTool : AFHTTPSessionManager
//单例实例化对象的方法
+ (instancetype)sharedTool;

//请求首页网络数据的方法
//-(void)requestHomeJsonDataFinished:(void(^)(id responseObject))finishedBlock  Failed:(void(^)(NSError* error))failedBlock;

/**
 
 获取十万个为什么、土豪专享列表数据
 @param type :0 土豪专享 1 十万个为什么 不传为全部
 @param orderType orderByTime：按时间排序；orderBySold：按销量排序
 @param page 请求的页数
 @param completedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requestRecommendJsonDataWithType:(NSInteger)type andOrderBy:(NSString *)orderType andPage: (NSInteger)page andFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;


/**

 获取十万个为什么详情数据

 @param detailID 详情的ID
 @param completedBlock 完成的回调
 @param failedBlock 失败的回调
 */
- (void)requestRecommendDetailDataWithDetailID:(NSInteger)detailID andFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;


//获取推荐界面数据
-(void)requestRecommendJsonDataFinished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


//获取达人详情界面数据
//app/specialColumn/getItemListById?id=56
-(void)requestDetailsJsonDataWithID:(NSNumber *)tid Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;

//获取试读界面数据
-(void)requestTryReadJsonDataWithID:(NSNumber *)tid Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;

/*
 获取连接网络类型

 @param successBlock  成功的回调
 */
- (void)isWiFiSuccessBlock:(void(^)(NSInteger state))successBlock;



//获取今今乐道 界面数据
-(void)requestTodayHappyTalkJsonDataFinished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;








/**
 请求榜单列表数据

 @param completedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requestHomeToplistDataFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 请求随身听的音频列表数据

 @param time 播放时间
 @param completedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requestListenAnyTimeResJasonDataWithTimeLen:(NSString *)time andFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;


//获取春花 界面数据
-(void)requestSpringFlowersJsonDataWithType:(NSInteger)type Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/*
 *金句页面数据
 **/
-(void)requestGoldSentenceWithType:(RequestType)type Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 获取榜单详情列表信息

 @param seriesId 榜单详情列表的ID
 @param completedBlock 成功回调
 @param failedBlock 失败回调
 */
- (void)requestToplistDetailBySeriesid:(NSInteger)seriesId andFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;
/*
 *
 @param page
 @param pageSize
 **/
-(void)requestFreeAudioFinished:(void(^)(id responseObject))completedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 获取搜索列表信息

 @param str 搜索的关键字
 @param finishedBlock 成功回调
 @param failedBlock 失败回调
 */
-(void)requestSearchResultJsonDataWithStr:(NSString *)str Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;






/**
 账号注册
 
 @param phoneNum 手机号
 @param password 密码
 @param finishedBlock 成功回调
 @param failedBlock 失败回调
 */
- (void)requstRegisterPhoneNum:(NSString *)phoneNum password:(NSString *)password Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 账号登录
 
 @param phoneNum 输入手机号
 @param password 输入密码
 @param token 返回的token
 @param finishedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requstLoginPhoneNum:(NSString *)phoneNum password:(NSString *)password andToken:(NSString *)token Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 修改密码
 
 @param newPassword 原来的密码
 @param oldPassword 新密码
 @param token token
 @param finishedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requstChangePhoneNum:(NSString *)newPassword andOldPassword:(NSString *)oldPassword andToken:(NSString *)token Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 获取验证码
 
 @param phoneNum 手机号
 @param finishedBlock 成功
 @param failedBlock 失败
 */
- (void)requstCodeNum:(NSString *)phoneNum Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 提交验证码
 
 @param codeNum 验证码
 @param phoneNum 手机号
 @param finishedBlock 成功的回调
 @param failedBlock 失败的回调
 */
- (void)requstCommitCode:(NSString *)codeNum andPhoneNum:(NSString *)phoneNum Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;



//1.0 版本首页数据请求接口
/*
 *@prama : parameter 请求参数
 **/
-(void)requestHomeJsonDataWithParameter:(id)parameter Finished:(void(^)(id responseObject))finishedBlock Failed:(void(^)(NSError* error))failedBlock;


/**
 微信分享接口

 @param platformType type = 1 分享朋友 type = 2 分享朋友圈
 @param shareMessage 要分享的信息
 */
- (void)shareTextToPlatformType:(UMSocialPlatformType)platformType andShareMessage: (NSString *)shareMessage;



/**
 微信登录 (模拟)

 @param platformType type = 1 微信登录
 */
- (void)getUserInfoForPlatform:(UMSocialPlatformType)platformType;

@end
